#include <bits/stdc++.h>
using namespace std;
using uint=unsigned int;
using ll=long long;
using ull=unsigned long long;
using i128=__int128;
const int N=1e6+5;

string chu(string a,ll b){
    ll len=a.size();
    ll temp=0;
    vector<ll> res;

    for(ll i=0;i<len;i++){
        ll num=a[i]-'0';
        res.push_back((temp*10+num)/b);
        temp=(temp*10+num)%b;
    }

    string ans;
    bool lead0=true;
    for(ll i=0;i<res.size();i++){
        if(res[i]==0&&lead0)continue;
        lead0=false;
        ans+=res[i]+'0';
    }
    
    return ans.empty()?"0":ans;
}

int main(){
    string a;
    ll b;
    cin>>a>>b;
    string result=chu(a,b);
    cout<<result<<endl;
}